]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Only reset UI on session resets while opened
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 14 Nov 2019 17:51:01 +0000 (18:51 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 15 Nov 2019 23:26:47 +0000 (23:26 +0000)
Since `_destroySession()` is not only called before we try to initiate a
new authentication session with Polkit, but also when the dialog is
closed, it's currently possible that key focus is grabbed by the close
button after the dialog was dismissed and hidden. This is causing a bug
where after dismissing one of multiple queued dialogs, key focus goes
away and keyboard navigation with the new dialog is impossible.

Fix this by only resetting the UI of the dialog if the dialog is still
opened/visible at that point.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/828

js/ui/components/polkitAgent.js

index 9fa3dff5d4fd601fb834f4217b832839eacc4805..1817aac05fb85da37b020dcf1c1c03b607a09811 100644 (file)
@@ -319,6 +319,9 @@ var AuthenticationDialog = GObject.registerClass({
         }
 
         let resetDialog = () => {
+            if (this.state != ModalDialog.State.OPENED)
+                return;
+
             this._passwordBox.hide();
             this._cancelButton.grab_key_focus();
             this._okButton.reactive = false;